package tw101.bm;

/**
 * Created by Alan on 12/29/13.
 */
public class AsteriskPrinter {

    public static void main(String args[]) {
        int asterisks = 0;

        try {
            asterisks = Integer.parseInt(args[0]);
        } catch (NumberFormatException e) {
            System.out.println("Run this program with one int as an argument.");
            System.exit(1);
        }

        //printOneAsterisk();
        //printHorizontalAsterisks(asterisks);
        printVeticalAsterisks(asterisks);
    }

    static void printOneAsterisk() {
        System.out.println("*");
    }

    static void printHorizontalAsterisks(int howMany) {
        for (int i=0; i<howMany; i++) {
            System.out.print("*");
        }
        System.out.println();
    }

    static void printVeticalAsterisks(int howMany) {
        for (int i=0; i<howMany; i++) {
            printOneAsterisk();
        }
    }
}